package Test1;//代表Test类在Test1包中
class Student{
    public static String classes;
    public int age;
    public String name;

    static {
        /**
         * this.age = 10 ❌
         */
        Student.classes = "111";
    }
    public static void set1(){
        System.out.println("2222");
    }
    public void set(){
        System.out.println("1111");
    }
    public static void get(){
        /**
         * set(); ❌
         */
        Student.set1();
        Student.classes = "3班";
        /**
         * this.age = 10 ❌
         */
    }

}
public class Test {
    public static void main(String[] args) {
        new Student();
    }
    public static void main1(String[] args) {
        {
            System.out.println("12345");
        }
        Student.classes = "一年级三班";//通过类名访问
        Student student1 = new Student();
        Student student2 = new Student();
        System.out.println(student1.classes);
        student1.classes = "二年级三班";//通过对象访问
        //因为classes是类的属性，因此student2也中的classes发生改变
        System.out.println(student2.classes);
    }
}
